################################################################################
#* Licensed Materials - Property of ShaoYang                                   #
#*                                                                             #         
#* OCO Source Materials                                                        #          
#*                                                                             #                 
#* (C) Copyright ShaoYang Corp. 2015 All Rights Reserved                       #
#*                                                                             # 
#* The source code for this program is not published or other-                 #
#* wise divested of its trade secrets, irrespective of what has                #
#* been deposited.                                                             # 
################################################################################

#*******************************************************************************
# Author:yushaoyang@cn.ibm.com
# Createdate:Fri Jun  5 21:29:16 2015
# Lastupd:Fri Jun  5 21:29:16 2015

# Description
# Updatelog:
# 1. "Init"
#*******************************************************************************

module Query
  module ExportService
    class QueryService
      include Restful::RouterDSL
      BASHPATH="/v1"

      def self.init_service dbcfgpath
        ymlpath=File.expand_path('../db/mongoid.yml', __FILE__)
        Mongoid.load!(ymlpath,:production)
      end

      GET "#{BASHPATH}/getRawData" do
        log.debug qparams
        Datacore.get_timeSlot qparams
      end


      GET "#{BASHPATH}/getLastTime" do
        log.debug qparams
        Datacore.get_lastTime qparams
      end

      GET "#{BASHPATH}/test" do
        log.debug "testing data"
        Datacore.fill_testData
      end

      DELETE "#{BASHPATH}/patientid/\\d" do
        result="hello"
      end

      PUT "#{BASHPATH}/coupons/\\d" do
        result="hello"
      end

      GET "#{BASHPATH}/coupons/_findBy*" do
        result="hello"
      end


      GET "#{BASHPATH}/coupons/_findBy/*/*" do
        result="hello"
      end

    end
  end
end